﻿// ------------------------------------------------------------------------------
// <copyright file="PieItem.cs" company="skumaronline.com">
//    Copyright (C) 2012 Suresh Kumar T.  All rights reserved.
// </copyright>
// ------------------------------------------------------------------------------

namespace StoreAppLib.Graph
{
    using System.Windows.Input;
    using Windows.UI.Xaml.Media;

    /// <summary>
    /// Represent a data source for Arc
    /// </summary>
    internal sealed class PieItem : BindableBase
    {
        /// <summary>
        /// Variable to hold the start angle.
        /// </summary>
        private double startAngle;

        /// <summary>
        /// Variable to hold the end angle.
        /// </summary>
        private double endAngle;

        /// <summary>
        /// Variable to hold the fill color.
        /// </summary>
        private Brush fill;

        /// <summary>
        /// Variable to hold the stroke color.
        /// </summary>
        private Brush stroke;

        /// <summary>
        /// Variable to hold the stroke thickness.
        /// </summary>
        private double strokeThickness;

        /// <summary>
        /// Variable to hold the value.
        /// </summary>
        private double value;

        /// <summary>
        /// Variable to hold the percentage.
        /// </summary>
        private double percentage;

        /// <summary>
        /// Variable to hold the command to capture tap event.
        /// </summary>
        private ICommand tapCommand;

        /// <summary>
        /// Gets or sets the source row.
        /// </summary>
        /// <value>
        /// The source row.
        /// </value>
        public object Source { get; set; }

        /// <summary>
        /// Gets or sets the percentage.
        /// </summary>
        /// <value>
        /// The percentage.
        /// </value>
        public double Percentage
        {
            get
            {
                return this.percentage;
            }

            set
            {
                this.SetProperty(ref this.percentage, value);
            }
        }

        /// <summary>
        /// Gets or sets the value.
        /// </summary>
        /// <value>
        /// The value.
        /// </value>
        public double Value
        {
            get
            {
                return this.value;
            }

            set
            {
                this.SetProperty(ref this.value, value);
            }
        }

        /// <summary>
        /// Gets or sets the end angle.
        /// </summary>
        /// <value>
        /// The end angle.
        /// </value>
        public double EndAngle
        {
            get
            {
                return this.endAngle;
            }

            set
            {
                this.SetProperty(ref this.endAngle, value);
            }
        }

        /// <summary>
        /// Gets or sets the start angle.
        /// </summary>
        /// <value>
        /// The start angle.
        /// </value>
        public double StartAngle
        {
            get
            {
                return this.startAngle;
            }

            set
            {
                this.SetProperty(ref this.startAngle, value);
            }
        }

        /// <summary>
        /// Gets or sets the fill color.
        /// </summary>
        /// <value>
        /// The fill color.
        /// </value>
        public Brush Fill
        {
            get
            {
                return this.fill;
            }

            set
            {
                this.SetProperty(ref this.fill, value);
            }
        }

        /// <summary>
        /// Gets or sets the stroke color.
        /// </summary>
        /// <value>
        /// The stroke color.
        /// </value>
        public Brush Stroke
        {
            get
            {
                return this.stroke;
            }

            set
            {
                this.SetProperty(ref this.stroke, value);
            }
        }

        /// <summary>
        /// Gets or sets the stroke thickness.
        /// </summary>
        /// <value>
        /// The stroke thickness.
        /// </value>
        public double StrokeThickness
        {
            get
            {
                return this.strokeThickness;
            }

            set
            {
                this.SetProperty(ref this.strokeThickness, value);
            }
        }

        /// <summary>
        /// Gets or sets the command to capture tap event.
        /// </summary>
        /// <value>
        /// The command to capture tap event.
        /// </value>
        public ICommand TapCommand
        {
            get
            {
                return this.tapCommand;
            }

            set
            {
                this.SetProperty(ref this.tapCommand, value);
            }
        }
    }
}
